// 导入静态路由
import { constantRoutes } from '@/router/index'
export default {
  namespaced: true,
  state: () => {
    return {
      // 初始值: 如果本地有就使用，没有就是''
      menuList: [...constantRoutes]
    }
  },
  mutations: {
    // 添加动态路由
    updateMenuList(state, asyncRoutes) {
      // state.menuList.push(...asyncRoutes)
      state.menuList = [...constantRoutes, ...asyncRoutes]
    }
  }
}
